import { AxiosPromise } from "axios";
import { sensitiveList, parameter } from "./type";
import service from "@/utils/request";
const { systemService } = service;

/**
 * 管理员获取敏感词列表
 *
 */
export function getSensitiveList(data: parameter): AxiosPromise<any> {
  return systemService({
    url: "/system/sensitiveWord/get",
    method: "get",
    params: data,
  });
}

/**
 * 删除敏感词
 */

export function deleteSensitive(ids: number[]): AxiosPromise<any> {
  return systemService({
    url: "/system/sensitiveWord/delete/" + ids,
    method: "delete",
  });
}

/**
 * 编辑敏感词
 */

export function editSensitive(data: sensitiveList): AxiosPromise<any> {
  return systemService({
    url: "/system/sensitiveWord/update",
    method: "put",
    data: data,
  });
}

export function addSensitive(data: sensitiveList): AxiosPromise<any> {
  return systemService({
    url: "/system/sensitiveWord/add",
    method: "post",
    data: data,
  });
}
